<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>群组管理</title>
<link rel="stylesheet" href="resources/static/css/pintuer.css">
<link rel="stylesheet" href="resources/static/css/admin.css">
<script src="resources/static/js/jquery.js"></script>
<script src="resources/static/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong class="icon-reorder"> 群组列表</strong></div>
  <div class="padding border-bottom">  
  	<button type="button" class="button border-yellow" onClick="window.location.href='group/toAddGroup'"><span class="icon-plus-square-o"></span> 增加群组</button>
  </div>
  <table class="table table-hover text-center">
    <tr>
      <th width="10%">序号</th>
      <th width="70%">群组名</th>
      <th width="20%">操作</th>
    </tr>
    <!--使用forEach遍历数据，并用EL表达式获取  -->
   <c:if test="${!empty groupList }">  
      <c:forEach items="${groupList}" var="group" varStatus="status">  
    	<tr>
    	<!-- 获取当前记录数 -->
      	<td>${status.index+1}</td>
      	<td>${group.groupname}</td>
      	<td><div class="button-group"><!--传入要修改的id ,前面的id要与实体bean对应 -->
      	 <a class="button border-main" href="group/toUpGroup?groupid=${group.groupid}" target="right"><span class="icon-edit"></span> 修改</a>
     	 <a class="button border-red"   href="group/delGroup?groupid=${group.groupid}" onclick="return(confirm('確定刪除?'))"><span class="icon-trash-o" ></span> 删除</a>
      </div></td>
    	</tr>
     </c:forEach>  
   </c:if> 
     
    
  </table>
</div>
</body></html>